https://discord.gg/botpress logo
The embed (iframe) version is not loading on mobil...
# 🤝help
h
Link: https://www.prometheusdgtl.com/test Bot ID: d88a6751-c573-4b5e-ab0e-7307345af14a Any idea why?
p
Can you share your code?
h
Copy code
javascript

<!-- In your <head> tag -->
<script src="https://cdn.botpress.cloud/webchat/v3.0/inject.js"></script>
<style>
  #webchat .bpWebchat {
    position: unset;
    width: 100%;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
  }

  #webchat .bpFab {
    display: none;
  }
</style>

<!-- In your <body> tag -->
<script>
document.addEventListener('DOMContentLoaded', () => {


window.botpress.on("webchat:ready", () => {
  window.botpress.open();
}); 

window.botpress.init({
  "botId": "d88a6751-c573-4b5e-ab0e-7307345af14a",
  "configuration": {
    "version": "v1",
    "composerPlaceholder": "Write your message...",
    "botName": "Kaptain AI",
    "botDescription": "Ο ψηφιακός βοηθός της Kaptain.",
    "website": {
      "title": "https://kaptain.gr/",
      "link": "https://kaptain.gr/"
    },
    "email": {
      "title": "info@kaptain.gr",
      "link": "info@kaptain.gr"
    },
    "phone": {
      "title": "+30 22210 32400",
      "link": "+30 22210 32400"
    },
    "termsOfService": {},
    "privacyPolicy": {},
    "color": "#1C3462",
    "variant": "solid",
    "headerVariant": "glass",
    "themeMode": "light",
    "fontFamily": "inter",
    "radius": 4,
    "feedbackEnabled": false,
    "footer": "[⚡ by Botpress](https://botpress.com/?from=webchat)",
    "allowFileUpload": false,
    "storageLocation": "localStorage"
  },
  "clientId": "99fbbd7b-1764-43af-a698-79519edeb53e",
  "selector": "#webchat"
});

}, false); // load

  
</script>
on desktop it's working fine. on mobile, no
p
This is what is hidding the icon: #webchat .bpFab { display: none; }
Unless I'm misunderstanding how you want it displayed... in which case can you alaborate on what it is supposed to look like?
p
Have you tried adding before the rest of the script in the body?
h
yes. although I don't see how that could affect anything. On desktop it's working fine.
also, I started debugging on the phone and the "webchat:ready" event is never called.
no error messages on console either :/
update: If I manually call
window.botpress.open()
then the webchat opens and runs normally. So the problem is that for some reason, the events are not called on mobile.
s
Oh wow! Running into an issue with this too just now. works on desktop but on mobile is just doesn't show up it's blank! Just an outline of the chat. https://cdn.discordapp.com/attachments/1381942163775950990/1384671335581483100/IMG_2712.jpg?ex=6853472c&is=6851f5ac&hm=a4e0824ba6b2d161c0e4249bf1e1d50629735f3ec836d2bda8732ef58dcfb563&
c
same problem here window.botpress.open() works on desktop (because some times on desktop does not work too) but on mobile does'nt
t
I am having the same issue. I cant get anything but the popup widget to work though. On desktop, all the scripts run on init, but the page is blank. I am however able to directly use iframe and then it works but the embed codes in the instructions dont work for me. 🤔
6 Views